home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
cross
/
GBDK-2.0.lha
/
GBDK
/
lib
/
ltoa.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-10-01
|
271b
|
22 lines
#include <stdlib.h>
char *ltoa(WORD n, char *s)
{
UBYTE i, sign;
if(n < 0) {
sign = 1;
n = -n;
} else
sign = 0;
i = 0;
do {
s[i++] = n % 10 + '0';
} while((n = n/10) > 0);
if(sign)
s[i++] = '-';
s[i] = 0;
reverse(s);
return s;
}